package com.cj.demo6.service;

import com.cj.demo6.mapper.Order_formMapper;
import com.cj.demo6.pojo.Order_form;
import com.cj.demo6.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

@Service
public class Order_formService {
    @Autowired
    Order_formMapper order_formMapper;
    public List<Order_form> selectAll(){
        return order_formMapper.selectList(null);
    }
    public int insert(Order_form order_form){
        return order_formMapper.insert(order_form);
    }
    public int update(Order_form order_form){
        return order_formMapper.updateById(order_form);
    }
    public int delete(int dId){
        return order_formMapper.deleteById(dId);
    }
    public int deletes(int[] dIds){
        return order_formMapper.deleteBatchIds(Arrays.asList(dIds));
    }
    public List<Order_form> selectMapper(Order_form order_form){
        HashMap<String,Object> map = new HashMap<String, Object>();
        map.put("d_id",order_form.getDId());
        map.put("d_message",order_form.getDMessage());
        map.put("d_remark",order_form.getDRemark());
        return order_formMapper.selectByMap(map);
    }
}
